<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection"content="telephone=no" />
    <title>Who are the killers</title>
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/assistant.css"/>
    <script src="js/angularjs/angular.min.js"></script>
</head>
<body ng-app="killer">
    <div class="container" ng-controller="killergame">
        <div class="col-md-12 alert-info gameinfo">
            <div class="resultshow col-md-12">
                <span>当前游戏总人数：{{players.length}}</span>，
                <span>存活总人数：{{alivecount}}<br/></span>
                <span>警察阵营存活数：{{goodmancount}}</span>，
                <span>杀手阵营存活数：{{badmancount}}<br/></span>
                <span>平民存活数：{{peplecount}}<br/></span>
                <div ng-if="game.isover" class="result">
                    <h4>游戏结束，{{winner}}获胜！！</h4>
                    <button class="btn btn-danger" ng-click="newgame()">重新开始</button>
                </div>
            </div>

        </div>
        <div class="row col-md-12 content">
            <div class="col-md-12">
                <h3>天黑请闭眼</h3>
            </div>
            <div class="col-md-12">
                <ul class="list-group">
                    <li class="player list-group-item" ng-class="{killed:player.isdead}" ng-repeat="player in players">
                        <span class="pshow" ng-class="{alive:!player.isdead}">
                            <a ng-click="player.role='未知'" class="playerroletext" ng-class="{killer:player.role=='杀手'}">【 {{player.role}} 】</a>
                            <span class="playername" ng-class="{police:player.role=='警察',killer:player.role=='杀手',specialpolice:player.role=='秘密警察',doctor:player.role=='医生',people:player.role=='平民'}">玩家{{player.number+1}}</span>
                            <button ng-if="player.role=='秘密警察'&&game.policechance==1" class="btn btn-default btn-sm" ng-click="(game.policechance=0)">特权</button>
                            <div class="playerstatus" ng-class="{killed:player.isdead}"></div>
                            <div ng-if="!player.isdead" class="gamebtn killbtn" ng-click="kill(player)">杀</div>
                            <div class="gamebtn rescuebtn rescue{{player.rescuedcount}}" ng-click="rescue(player)">救{{player.rescuedcount}}</div>
                        </span>
                        <div class="rolebtns" ng-if="player.role=='未知'" style="clear:both;">
                            <button class="btn btn-default btn-sm" ng-click="player.setrole('杀手')">杀手</button>
                            <button class="btn btn-default btn-sm" ng-click="player.setrole('警察')">警察</button>
                            <button class="btn btn-default btn-sm" ng-click="player.setrole('秘密警察')">秘密警察</button>
                            <button class="btn btn-default btn-sm" ng-click="player.setrole('医生')">医生</button>
                            <button class="btn btn-default btn-sm" ng-click="player.setrole('平民')">平民</button>
                            <button class="btn btn-danger btn-sm" ng-click="removeplayer($index)"><span class="glyphicon glyphicon-trash"></span></button>
                        </div>
                        <div style="clear:both;"></div>
                    </li>
                </ul>
            </div>
            <div class="col-md-12">

                <button ng-if="game.isover==0" class="btn btn-default" ng-click="nighttip()">夜晚提示</button>
            </div>
            <div ng-if="game.nighttip==1" class="alert-warning nighttip">
                <p ng-repeat="text in nighttiptext">{{text}}</p>
                <button ng-click="game.nighttip=0" class="btn btn-default btn-sm" >关闭</button>
            </div>

            <div class="col-md-12" style="margin-top:0.5em;">
                <button class="delbtn col-md-12 btn btn-success" ng-click="addplayer()" style="float:left;">添加玩家</button>
                <button class="btn btn-danger" ng-click="newgame()" style="float:right;">重新开始</button>
                <div style="clear:both;"></div>
            </div>
        </div>

    </div>

</body>
<script src="js/assistant.js"></script>
</html>